<?php
//We've included ../Includes/FusionCharts.php, which contains functions
//to help us easily embed the charts.
include("Includes/FusionCharts.php");
?>

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script language="Javascript" src="FusionCharts/FusionCharts.js"></script>
</head>
<body>
	<div id="container">
	
		<div id="header">
		
			<div id="logo">
			</div>
		
		</div>
		
		<div id="wrapper">
		    <div class="main">
				
				<div class="LeftColumn">
					<?php
	//In this example, we plot a single series chart from data contained
	//in an array. The array will have two columns - first one for data label
	//and the next one for data values.
	
	//Let's store the sales data for 6 products in our array). We also store
	//the name of products. 
	//Store Name of Products
	$arrData[0][1] = "Product A";
	$arrData[1][1] = "Product B";
	$arrData[2][1] = "Product C";
	$arrData[3][1] = "Product D";
	$arrData[4][1] = "Product E";
	$arrData[5][1] = "Product F";
	//Store sales data
	$arrData[0][2] = 567500;
	$arrData[1][2] = 815300;
	$arrData[2][2] = 556800;
	$arrData[3][2] = 734500;
	$arrData[4][2] = 676800;
	$arrData[5][2] = 648500;

	//Now, we need to convert this data into XML. We convert using string concatenation.
	//Initialize <chart> element
	$strXML = "<chart caption='TA Presentasi Etc' numberPrefix='$' formatNumberScale='0'>";
	//Convert data to XML and append
	foreach ($arrData as $arSubData)
		$strXML .= "<set label='" . $arSubData[1] . "' value='" . $arSubData[2] . "' />";

	//Close <chart> element
	$strXML .= "</chart>";
	
	//Create the chart - Column 3D Chart with data contained in strXML
	echo renderChart("FusionCharts/Column2D.swf", "", $strXML, "productSales", 600, 300, false, false);
	?>
				</div>
				
				<div class="RightColumn">
					<?php
	//In this example, we plot a single series chart from data contained
	//in an array. The array will have two columns - first one for data label
	//and the next one for data values.
	
	//Let's store the sales data for 6 products in our array). We also store
	//the name of products. 
	//Store Name of Products
	$arrData1[0][1] = "Product A";
	$arrData1[1][1] = "Product B";
	$arrData1[2][1] = "Product C";
	$arrData1[3][1] = "Product D";
	$arrData1[4][1] = "Product E";
	$arrData1[5][1] = "Product F";
	//Store sales data
	$arrData1[0][2] = 567500;
	$arrData1[1][2] = 815300;
	$arrData1[2][2] = 556800;
	$arrData1[3][2] = 734500;
	$arrData1[4][2] = 676800;
	$arrData1[5][2] = 648500;

	//Now, we need to convert this data into XML. We convert using string concatenation.
	//Initialize <chart> element
	$strXML1 = "<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'>";
	//Convert data to XML and append
	foreach ($arrData1 as $arSubData)
		$strXML1 .= "<set label='" . $arSubData[1] . "' value='" . $arSubData[2] . "' />";

	//Close <chart> element
	$strXML1 .= "</chart>";
	
	//Create the chart - Column 3D Chart with data contained in strXML
	echo renderChart("FusionCharts/Bar2D.swf", "", $strXML1, "xproductSales", 600, 300, false, false);
	?>
				</div>
			</div>
			<div class="clear"></div>
			
			
			
			<div class="main">
				
				<div class="LeftColumn">
					<?php
	//In this example, we plot a single series chart from data contained
	//in an array. The array will have two columns - first one for data label
	//and the next one for data values.
	
	//Let's store the sales data for 6 products in our array). We also store
	//the name of products. 
	//Store Name of Products
	$arrData2[0][1] = "Product A";
	$arrData2[1][1] = "Product B";
	$arrData2[2][1] = "Product C";
	$arrData2[3][1] = "Product D";
	$arrData2[4][1] = "Product E";
	$arrData2[5][1] = "Product F";
	//Store sales data
	$arrData2[0][2] = 567500;
	$arrData2[1][2] = 815300;
	$arrData2[2][2] = 556800;
	$arrData2[3][2] = 734500;
	$arrData2[4][2] = 676800;
	$arrData2[5][2] = 648500;

	//Now, we need to convert this data into XML. We convert using string concatenation.
	//Initialize <chart> element
	$strXML2 = "<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='0'>";
	//Convert data to XML and append
	foreach ($arrData2 as $arSubData)
		$strXML2 .= "<set label='" . $arSubData[1] . "' value='" . $arSubData[2] . "' />";

	//Close <chasrt> element
	$strXML2 .= "</chart>";
	
	//Create the chart - Column 3D Chart with data contained in strXML
	echo renderChart("FusionCharts/Line.swf", "", $strXML2, "x2productSales", 600, 300, false, false);
	?>
				</div>
				
				<div class="RightColumn">
				
				<?php
	//In this example, we plot a single series chart from data contained
	//in an array. The array will have two columns - first one for data label
	//and the next one for data values.
	
	//Let's store the sales data for 6 products in our array). We also store
	//the name of products. 
	//Store Name of Products
	$arrData2[0][1] = "Product A";
	$arrData2[1][1] = "Product B";
	$arrData2[2][1] = "Product C";
	$arrData2[3][1] = "Product D";
	$arrData2[4][1] = "Product E";
	$arrData2[5][1] = "Product F";
	//Store sales data
	$arrData2[0][2] = 567500;
	$arrData2[1][2] = 815300;
	$arrData2[2][2] = 556800;
	$arrData2[3][2] = 734500;
	$arrData2[4][2] = 676800;
	$arrData2[5][2] = 648500;
	
	//Store sales data for previous year
	$arrData2[0][3] = 547300;
	$arrData2[1][3] = 584500;
	$arrData2[2][3] = 754000;
	$arrData2[3][3] = 456300;
	$arrData2[4][3] = 754500;
	$arrData2[5][3] = 437600;

	//Now, we need to convert this data into XML. We convert using string concatenation.
	//Initialize <chart> element
	$strXML2 = "<chart caption='Sales by Product' numberPrefix='$' formatNumberScale='1' rotateValues='1' placeValuesInside='1' decimals='0' >";
	//Initialize <categories> element - necessary to generate a multi-series chart
	$strCategories = "<categories>";
	//Initiate <dataset> elements
	$strDataCurr = "<dataset seriesName='Presentation'>";
	$strDataPrev = "<dataset seriesName='Oppurtinity'>";
	//Convert data to XML and append
	foreach ($arrData2 as $arSubData) {
        //Append <category name='...' /> to strCategories
        $strCategories .= "<category name='" . $arSubData[1] . "' />";
        //Add <set value='...' /> to both the datasets
        $strDataCurr .= "<set value='" . $arSubData[2] . "' />";
        $strDataPrev .= "<set value='" . $arSubData[3] . "' />";
	}

	//Close <categories> element
	$strCategories .= "</categories>";
	
	//Close <dataset> elements
	$strDataCurr .= "</dataset>";
	$strDataPrev .= "</dataset>";
	
	//Assemble the entire XML now
	$strXML2 .= $strCategories . $strDataCurr . $strDataPrev . "</chart>";
	
	//Create the chart - Column 3D Chart with data contained in strXML
	echo renderChart("FusionCharts/MSLine.swf", "", $strXML2, "x3productSales", 600, 300, false, false);
	?>
				
				</div>
			</div>
			<div class="clear"></div>
			
		</div>
		<div class="clear"></div>
		
		<div id="footer">
		    <marquee>
				test
			</marquee>
		</div>
		
	</div>
</body>
</html> 